<template>
  <div class="avue-crud__img" @click="previewImage">
    <img :src="imageUrl" :alt="alt" />
  </div>
</template>
<script>
export default {
  name: "uploadImg",
  props: {
    imageUrl: {
      type: String,
      dafault: "",
    },
    alt: {
      type: String,
      dafault: "",
    },
  },
  data() {
    return {};
  },
  methods: {
    previewImage() {
      let datas = [
        {
          thumbUrl: this.imageUrl, //缩略图
          url: this.imageUrl, //大图
        },
      ];
      let index = 0; //默认打开序号
      this.$ImagePreview(datas, index);
    },
  },
};
</script>
